{% extends 'base.html' %}
{% load gae_filters %}

{% block stylesheet %}
{{ block.super }}
{% endblock%}

{% block javascript %}
{{ block.super }}
<script type="text/javascript" src="{% url base_static "js/jquery.tablesorter.min.js" %}"></script>
<script type="text/javascript">
$(document).ready(function(){
    $("#school_list").tablesorter();
    $('table.list tr:even').addClass("even");
    $("span").click(function(){
        var value = $(this).attr("id");
        schoolId = value.split(".")[1];

        var targetUrl = "/base/school/detail/" + schoolId;
        $("#extra_info").load(targetUrl);
    });
});
</script>
{% endblock %}

{% block content %}
<h3>School Summary</h3>
<table class="tablesorter list">
<thead>
    <tr>
        <th>초등학교</th>
        <th>중학교</th>
        <th>고등학교</th>
        <th>기타</th>
    </tr>
</thead>
<tbody>
    <tr>
        <td>{{ stat.P }}</td>
        <td>{{ stat.M }}</td>
        <td>{{ stat.H }}</td>
        <td>{{ stat.etc }}</td>
    </tr>
</tbody>
</table>

<div id="navi">
    <ul>
        <li><a href="{% url school_create %}">school create</a></li>
        <li><a href="{% url school_list_csv %}">school csv</a></li>
    </ul>
</div>

<h3>School List</h3>
{% include "school/_list.html" %}
{% endblock %}